﻿//-----------------------------------------------------------------------
// <copyright file="MPayload.cs" company="SLWY Enterprises">
// * Copyright (C) 2017 四川商旅无忧科技有限公司 版权所有。
// * version : 1.0
// * author  : lilei
// * FileName: MPayload.cs
// * history : created by qinchaoyue 2017-10-16 02:39:55
// </copyright>
//-----------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Text;

namespace Slwy.JwtAuth
{
    /// <summary>
    /// JWT 载荷（Payload）
    /// </summary>
    public class MJwtPayload
    {
        /// <summary>
        /// 用户ID
        /// </summary>
        private string uid = string.Empty;

        /// <summary>
        ///  该JWT的签发者
        /// </summary>
        public string ISS { get; set; } = string.Empty;

        /// <summary>
        /// 该JWT所面向的用户
        /// </summary>
        public string Sub { get; set; } = "Web";

        /// <summary>
        ///  接收该JWT的一方
        /// </summary>
        public string Aud { get; set; } = string.Empty;

        /// <summary>
        /// (expires): 什么时候过期，这里是一个Unix时间戳
        /// </summary>
        public string Exp = string.Empty;

        /// <summary>
        /// (issued at): 在什么时候签发的
        /// </summary>
        public string Iat { get; set; }

        /// <summary>
        /// 其他内容，可以为空.
        /// </summary>
        /// <value>
        /// The content.
        /// </value>
        public string Content { get; set; } = string.Empty;

        /// <summary>
        /// 用户帐号
        /// </summary>
        public string UName = string.Empty;

        /// <summary>
        /// 用户ID
        /// </summary>
        public string UID { get; set; } = string.Empty;

        /// <summary>
        /// Gets or sets the dept identifier.
        /// </summary>
        /// <value>
        /// The dept identifier.
        /// </value>
        public string DeptID { get; set; } = string.Empty;

        /// <summary>
        /// 公司ID
        /// </summary>
        public string CompanyID { get; set; } = string.Empty;

        /// <summary>
        /// 用户帐号
        /// </summary>
        public string UserName{ get; set; } = string.Empty;

        /// <summary>
        /// 权限角色
        /// </summary>
        public int Role { get; set; }
    }
}
